package com.vanke.kotlin_mvp.data

import java.util.*

/**
 * @name Kotlin_MVP
 * @package name：com.vanke.kotlin_mvp.data
 * @class describe
 * @anthor shiyuchuan
 * @time 2017/8/17 9:32
 */
data class Task constructor(val title: String,
                            val description: String,
                            val id: String = UUID.randomUUID().toString()) {
    var isCompleted = false

    val titleForList: String
        get() {
            if (title.isNotEmpty()) {
                return title
            } else {
                return description
            }
        }

    val isActive: Boolean
        get() = !isCompleted

    val isEmpty: Boolean
        get() = title.isEmpty() && description.isEmpty()

}